Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

workaround for IE model + clipping planes shader bug #6584

Merged
merged 2 commits into from
May 11, 2018

Conversation

likangning93
Copy link
Contributor

Fixes #6575

@cesium-concierge
Copy link

Signed CLA is on file.

@likangning93, thanks for the pull request! Maintainers, we have a signed CLA from @likangning93, so you can review this at any time.


I am a bot who helps you make Cesium awesome! Contributions to my configuration are welcome.

🌍 🌎 🌏

// Internet Explorer seems to have problems with discard after too many levels of indirection:
// https://github.com/AnalyticalGraphicsInc/cesium/issues/6575.
// In this case, log depth modifications are empty wrappers and can be omitted.
if (!FeatureDetection.isInternetExplorer()) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not detect if log depth is supported instead of checking IE specifically?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's an IE bug more than a log depth bug, so I think this is more descriptive.

We could also check inside the modified functions for log depth support and just not modify the shader, but I'm not sure if there was some reason that wasn't happening already.
Maybe the current design was to keep log depth toggling to a single shader define for simplicity?
We'd also have to wire access to the context down to the modifier functions too.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you try other browsers/OS's without log depth just to be sure? My main concern is that we don't know WHY it's crashing in IE, right? We just assume it's a bug in IE and not something non-standard in our own code.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clipping planes and picking with clipping planes seem to work fine on Chrome on my Android phone, which doesn't have the extensions needed for log depth.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, cool thanks for checking.

@@ -2041,10 +2049,13 @@ define([
var drawVS = modifyShader(vs, id, model._vertexShaderLoaded);
var drawFS = modifyShader(finalFS, id, model._fragmentShaderLoaded);

drawVS = ModelUtility.modifyVertexShaderForLogDepth(drawVS, toClipCoordinatesGLSL);
drawFS = ModelUtility.modifyFragmentShaderForLogDepth(drawFS);
if (!FeatureDetection.isInternetExplorer()) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment

@@ -2058,8 +2069,13 @@ define([
pickFS = modifyShaderForClippingPlanes(pickFS, clippingPlaneCollection);
}

pickVS = ModelUtility.modifyVertexShaderForLogDepth(pickVS, toClipCoordinatesGLSL);
pickFS = ModelUtility.modifyFragmentShaderForLogDepth(pickFS);
// Internet Explorer seems to have problems with discard after too many levels of indirection:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would move this comment to the first check instead of last so readers encounter it sooner.

@lilleyse
Copy link
Contributor

Thanks @likangning93. I don't have any comments to add, the bug is fixed.

@lilleyse lilleyse merged commit 97eb855 into CesiumGS:master May 11, 2018
@lilleyse lilleyse deleted the clippingPlanesIeBugfix branch May 11, 2018 20:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants